<?php
class Zend_View_Helper_showTableCategory {

    public function showTableCategory($view) {
        
        $arrCategory = $view->arrCategory; 
        $strHtml = '';
        $strHtml .= '<table class="hovertable">';
        $strHtml .= '<tr>';
        $strHtml .= '<th>Tên </th>';
        $strHtml .= '<th>Tên file hình</th>';
        $strHtml .= '<th>Parent_id</th>';
        $strHtml .= '<th>Sắp xếp</th>';
        $strHtml .= '<th>Ngày tạo</th>';
        $strHtml .= '<th>Thay đổi</th>';
        $strHtml .= '<th>Thao tác</th>';
        $strHtml .= '</tr>';
        if(isset($arrCategory))
        foreach ($arrCategory as $Category) {
            
            $strHtml .= '<tr id="tablerow">';
            $strHtml .= '<td> <a href="'.$view->baseUrl().'/Category/detail/id/'.$Category->category_id.'">'. $Category->category_name. '</a></td>';
            $strHtml .= '<td>'. $Category->category_image.'</td>';
            $strHtml .= '<td>'. $Category->parent_id.'</td>';
            $strHtml .= '<td>'. $Category->sort_order.'</td>';
            $strHtml .= '<td>'. $Category->date_added.'</td>';
            $strHtml .= '<td>'. $Category->last_modified.'</td>';
            $strHtml .= '<td>
                             <a class="icon-1" href="'.$view->baseUrl().'/category/edit/id/'.$Category->category_id.'"/>
                             <a class="icon-2" href="'.$view->baseUrl().'/category/delete/id/'.$Category->category_id.'"/>
                             </td>';
            $strHtml .= '</tr>';
        }
        
        $strHtml .= '</table>';
        return $strHtml ;
    }
}